import { DataTypes } from 'sequelize'

import Seq from '../config/sequelize.ts'

// 拼车类型表
const Table = Seq.define(
  'carpool_type',
  {
    carpool_type_id: {
      type: DataTypes.UUID,
      defaultValue: DataTypes.UUIDV4,
      primaryKey: true,
      allowNull: false,
      unique: true,
      comment: '拼车ID',
    },
    carpool_type: {
      type: DataTypes.STRING,
      allowNull: false,
      unique: 'carpool_type',
      comment: '拼车类型',
    },
    carpool_type_name: {
      type: DataTypes.STRING,
      allowNull: false,
      comment: '拼车类型名称',
    },
    remark: {
      type: DataTypes.STRING,
      comment: '备注',
    },
  },
  {
    // 防止表名变成复数
    freezeTableName: true,
  },
)

// Table.sync({ alter: true })
// Table.sync({ force: false })

export default Table
